home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 31 / Amiga Format CD31 (1998-09-02)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1998-10].iso / -seriously_amiga- / hardware / transadf / source / util.h < prev    next >
C/C++ Source or Header  |  1998-07-20  |  3KB  |  85 lines

  1. /* util.h - Header file for util.c
  2. ** Copyright (C) 1997,1998 Karl J. Ots
  3. ** 
  4. ** This program is free software; you can redistribute it and/or modify
  5. ** it under the terms of the GNU General Public License as published by
  6. ** the Free Software Foundation; either version 2 of the License, or
  7. ** (at your option) any later version.
  8. ** 
  9. ** This program is distributed in the hope that it will be useful,
  10. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. ** GNU General Public License for more details.
  13. ** 
  14. ** You should have received a copy of the GNU General Public License
  15. ** along with this program; if not, write to the Free Software
  16. ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  17. */
  18.  
  19. #ifndef TRANSADF_UTIL_H
  20. #define TRANSADF_UTIL_H
  21.  
  22.  
  23. /*------------------------------------*/
  24. /* Miscellaneous functions and macros */
  25. /*------------------------------------*/
  26.  
  27. #ifndef EXEC_TYPES_H
  28. #include <exec/types.h>
  29. #endif /* EXEC_TYPES_H */
  30.  
  31. #ifndef DOS_DOS_H
  32. #include <dos/dos.h>
  33. #endif /* DOS_DOS_H */
  34.  
  35. #ifndef CLIB_EXEC_PROTOS_H
  36. #include <clib/exec_protos.h>
  37. #endif /* CLIB_EXEC_PROTOS_H */
  38.  
  39. #ifndef CLIB_DOS_PROTOS_H
  40. #include <clib/dos_protos.h>
  41. #endif /* CLIB_DOS_PROTOS_H */
  42.  
  43.  
  44. /*---------------*/
  45. /* Useful Macros */
  46. /*---------------*/
  47.  
  48. /* Output the track and side of (ULONG) tr to (BPTR) f. */
  49. #define FPUTS_TS(tr,f) FPrintf ((f),"track %ld side %ld",((tr)>>1),((tr)&1))
  50.  
  51. /* Check to see if Control-C has been pressed */
  52. #define CTRL_C         (SetSignal(NULL,NULL) & SIGBREAKF_CTRL_C)
  53.  
  54.  
  55. /* File types as returned by getFileType() */
  56. #define FT_UNKNOWN    0    /* Default file type.                          */
  57. #define FT_DOS        1    /* AmigaDOS disk.                              */
  58. #define FT_ZLIB       2    /* ZLib stream (as defined in RFC-1950).       */
  59. #define FT_GZIP       3    /* GZip file (as defined in RFC-1952).         */
  60. #define FT_PKZIP      4    /* 'Standard' Zip as used by PK- and Info-Zip. */
  61. #define FT_PKZIP_ADD  5    /* Add a new file to a PKZip archive.          */
  62.  
  63.  
  64. /*---------------------*/
  65. /* Function prototypes */
  66. /*---------------------*/
  67.  
  68. LONG   Name2Unit (STRPTR devName);
  69.  
  70. #ifndef COMPILE_LITE
  71. ULONG  getFileType (BPTR file);
  72. BOOL   writeHead (BPTR outFile, STRPTR origName, ULONG fileType);
  73. BOOL   finishFile (BPTR outFile, ULONG CRC, ULONG CSize, ULONG USize, 
  74.                    ULONG fileType);
  75. BOOL   skipHead (BPTR inFile, STRPTR origName, ULONG fileType);
  76. BOOL   readTail (BPTR inFile, ULONG *CRC, ULONG *USize, ULONG fileType);
  77. ULONG  unixDate (void);
  78. ULONG  dosDate (void);
  79. UWORD  LES (UWORD num);
  80. ULONG  LEL (ULONG num);
  81. #endif /* COMPILE_LITE */
  82.  
  83.  
  84. #endif /* TRANSADF_UTIL_H */
  85.